Dear friends,
I would ike to estimate the production function for three inputs capital (lnk), labour(lnl) and material (lnm). I run thw following command:
But I get this:
My data has over 200,000 observations. I do not know why the codes does not work while the observation from the table is just 169! it seems the number of countries, but I cannot get the estimations of alpha, beta and gamma!
ANY HELP PLEASE
I would ike to estimate the production function for three inputs capital (lnk), labour(lnl) and material (lnm). I run thw following command:
* Countries
levelsof country, local(ctrs)
* Collector
tempname mem
postfile `mem' str40 country byte fit_ok ///
double(alpha beta gamma se_alpha se_beta se_gamma rts p_rts) ///
using elasticities_acf_go, replace
foreach c of local ctrs {
preserve
keep if country == "`c'"
* Gross output specification is the default
quietly cap noi prodest lnVA, ///
free(lnl) state(lnk) proxy(lnm) ///
met(op) poly(3) reps(40) ///
id(firm_id) t(year) fsresiduals(fs_acf_op)
if !_rc capture scalar `a' = _b[k]
if !_rc capture scalar `b' = _b[l]
if !_rc capture scalar `g' = _b[m]
scalar rts = alpha + beta + gamma
quietly testnl _b[lnl] + _b[lnk] + _b[lnm] = 1
scalar p_rts = r(p)
post `mem' ("`c'") (1) (alpha) (beta) (gamma) ///
(se_alpha) (se_beta) (se_gamma) (rts) (p_rts)
}
else {
post `mem' ("`c'") (0) (.) (.) (.) (.) (.) (.) (.) (.)
}
}
postclose `mem'
use elasticities_acf_go, clear
order country fit_ok alpha se_alpha beta se_beta gamma se_gamma rts p_rts
label var fit_ok "estimation succeeded 1 or failed 0"
export excel using "elasticities_by_country_acf_go.xlsx", firstrow(variables) replace
levelsof country, local(ctrs)
* Collector
tempname mem
postfile `mem' str40 country byte fit_ok ///
double(alpha beta gamma se_alpha se_beta se_gamma rts p_rts) ///
using elasticities_acf_go, replace
foreach c of local ctrs {
preserve
keep if country == "`c'"
* Gross output specification is the default
quietly cap noi prodest lnVA, ///
free(lnl) state(lnk) proxy(lnm) ///
met(op) poly(3) reps(40) ///
id(firm_id) t(year) fsresiduals(fs_acf_op)
if !_rc capture scalar `a' = _b[k]
if !_rc capture scalar `b' = _b[l]
if !_rc capture scalar `g' = _b[m]
scalar rts = alpha + beta + gamma
quietly testnl _b[lnl] + _b[lnk] + _b[lnm] = 1
scalar p_rts = r(p)
post `mem' ("`c'") (1) (alpha) (beta) (gamma) ///
(se_alpha) (se_beta) (se_gamma) (rts) (p_rts)
}
else {
post `mem' ("`c'") (0) (.) (.) (.) (.) (.) (.) (.) (.)
}
}
postclose `mem'
use elasticities_acf_go, clear
order country fit_ok alpha se_alpha beta se_beta gamma se_gamma rts p_rts
label var fit_ok "estimation succeeded 1 or failed 0"
export excel using "elasticities_by_country_acf_go.xlsx", firstrow(variables) replace
30((null))
.((null))
.((null))
.((null))
.((null))
.((null))
.((null))
.((null))
.((null))
.((null))
40((null))
op productivity estimator Cobb-Douglas PF
Dependent variable: revenue Number of obs = 169
Group variable (id): firm_id Number of groups = 25
Time variable (t): year
Obs per group: min = 1
avg = 6.8
max = 14
------------------------------------------------------------------------------
lnVA | Coefficient Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
lnl | .1387592 .1085323 1.28 0.201 -.0739602 .3514786
lnk | .539456 .380662 1.42 0.156 -.2066277 1.28554
------------------------------------------------------------------------------
Wald test on Constant returns to scale: Chi2 = 0.82
p = (0.37)
gamma not found
r(111);
end of do-file
r(111);
.
.((null))
.((null))
.((null))
.((null))
.((null))
.((null))
.((null))
.((null))
.((null))
40((null))
op productivity estimator Cobb-Douglas PF
Dependent variable: revenue Number of obs = 169
Group variable (id): firm_id Number of groups = 25
Time variable (t): year
Obs per group: min = 1
avg = 6.8
max = 14
------------------------------------------------------------------------------
lnVA | Coefficient Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
lnl | .1387592 .1085323 1.28 0.201 -.0739602 .3514786
lnk | .539456 .380662 1.42 0.156 -.2066277 1.28554
------------------------------------------------------------------------------
Wald test on Constant returns to scale: Chi2 = 0.82
p = (0.37)
gamma not found
r(111);
end of do-file
r(111);
.
My data has over 200,000 observations. I do not know why the codes does not work while the observation from the table is just 169! it seems the number of countries, but I cannot get the estimations of alpha, beta and gamma!
ANY HELP PLEASE
